package com.zzt.aop.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created with IntelliJ IDEA.
 * Description
 * User: panda
 * Date: 2025-03-30
 * Time: 16:59
 */
public class JDKInvocation implements InvocationHandler {

    //目标对象，被代理对象
    private Object target;

    public JDKInvocation(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("我开始代理...");
        Object result = method.invoke(target, args);
        return result;
    }
}
